<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1，user-scalable=no" />
    <link rel="stylesheet" type="text/css" href="css/reset.css"/>
    <link rel="stylesheet" type="text/css" href="css/search.css"/>
    <title>Title</title>
    

  
</head>
<style>

</style>
<body>
    <div class="search">
            <header>
                    <input type="text" placeholder="Search">
                  
                                <span>取消</span>
                   
                  
            </header>
            <div class="neirong">
                    <p>热搜</p>
                    <div class="biaoqian">
                            <div>项目管理</div>
                            <div>移动互联网</div>
                            <div>O2O联转化</div>
                            <div>O2O</div>
                            <div>媒介平台</div>
                            <div>细分平台业务</div>
                            <div>项目管理</div>
                            <div>移动互联网</div>
                            <div>O2O联转化</div>


                    </div>
            </div>
    </div>
</body>

<script>
    function recalc() {
	var clientWidth = document.documentElement.clientWidth;
	if(!clientWidth) return;
	document.documentElement.style.fontSize = 40 * (clientWidth / 640) + 'px';
}

function initRecalc() {
	recalc();
	var resizeEvt = 'osrientationchange' in window ? 'orientationchange' : 'resize';
	if(!document.addEventListener) return;
	window.addEventListener(resizeEvt, recalc, false);
	document.addEventListener('DOMContentLoaded', recalc, false);
}
initRecalc();

 console.log("手机viewportWidth=",document.documentElement.clientWidth);
    //获取viewport宽
    var viewportWidth = document.documentElement.clientWidth;
    console.log(document.documentElement.style.fontSize);

</script>

</html>